]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/scroll-view: Remove scrollbars references on dispose
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Fri, 3 Aug 2018 17:06:47 +0000 (19:06 +0200)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Wed, 30 Oct 2019 00:08:27 +0000 (01:08 +0100)
As we're destroying the scrollbars on destruction, we should remove any
reference of it, not to cause multiple-calls to disposal to unreference them
again.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/190

src/st/st-scroll-view.c

index 029e4a356d0045c915813c187d261281f1597f46..79af3ca13a3945bed83602302e15796ea6fccb8d 100644 (file)
@@ -250,11 +250,8 @@ st_scroll_view_dispose (GObject *object)
       priv->fade_effect = NULL;
     }
 
-  if (priv->vscroll)
-    clutter_actor_destroy (priv->vscroll);
-
-  if (priv->hscroll)
-    clutter_actor_destroy (priv->hscroll);
+  g_clear_pointer (&priv->vscroll, clutter_actor_destroy);
+  g_clear_pointer (&priv->hscroll, clutter_actor_destroy);
 
   /* For most reliable freeing of memory, an object with signals
    * like StAdjustment should be explicitly disposed. Since we own